<style type="text/css">
    .variable_function{
        display: none;
    }
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
            <span id="reference-name" class="help-block"> </span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Value_source')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-value_source" data-rule="required" class="form-control selectpicker" name="row[value_source]">
                {foreach name="valueSourceList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group variable_sql">
        <label class="control-label col-xs-12 col-sm-2">{:__('Sql')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-sql" placeholder="" class="form-control" name="row[sql]" type="text"></textarea>
            <span class="help-block">可使用 __PREFIX__ 表示数据库前缀,如：SELECT count(id) FROM __PREFIX__user</span>
            <span class="help-block">将在需要时，自动使用 Db::query(SQL); 来获取变量值</span>
        </div>
    </div>
    <div class="form-group variable_function">
        <label class="control-label col-xs-12 col-sm-2">{:__('Namespace')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-namespace" class="form-control" name="row[namespace]" type="text" value="">
        </div>
    </div>
    <div class="form-group variable_function">
        <label class="control-label col-xs-12 col-sm-2">{:__('Class')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-class" class="form-control" name="row[class]" type="text" value="">
        </div>
    </div>
    <div class="form-group variable_function">
        <label class="control-label col-xs-12 col-sm-2">{:__('Function')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-function" class="form-control" name="row[function]" type="text" value="">
        </div>
    </div>
    <div class="form-group variable_function">
        <label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-params" class="form-control" name="row[params]" type="text" value="">
            <span class="help-block">将使用 Hook::exec('命名空间\类名','方法名',参数); 来获取变量值</span>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
